'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')

function getIPAddress() {
    var interfaces = require("os").networkInterfaces();
    for (var devName in interfaces) {
        var iface = interfaces[devName];
        for (var i = 0; i < iface.length; i++) {
            var alias = iface[i];
            if (
                alias.family === "IPv4" &&
                alias.address !== "127.0.0.1" &&
                !alias.internal
            ) {
                return alias.address;
            }
        }
    }
}

module.exports = merge(prodEnv, {
  NODE_ENV: '"development"',
  BASE_API: '"http://'+ getIPAddress() + ':8888"',
})
